TOPDIR = ../..
include $(TOPDIR)/src/include/builddefs

SCRIPTS = pmsnap.sh
CONFIGS = crontab.IN Snap control
HTMLDOC = summary.html
LDIRT = crontab

CONFIGETC = $(PCP_SYSCONF_DIR)/pmsnap
CONFIGVAR = $(PCP_VAR_DIR)/config/pmsnap

default: crontab

crontab : crontab.IN
	$(SED) -e '/\# .*/b' -e 's;PCP_BINADM_DIR;$(PCP_BINADM_DIR);g' < $< > $@

include $(BUILDRULES)

install: default
ifeq "$(ENABLE_QT)" "true"
	$(INSTALL) -m 755 -d $(PCP_BINADM_DIR)
	$(INSTALL) -m 755 pmsnap.sh $(PCP_BINADM_DIR)/pmsnap
	$(INSTALL) -m 755 -d $(CONFIGETC)
	$(INSTALL) -m 755 -d $(CONFIGVAR)
	$(INSTALL) -m 644 -t $(CONFIGVAR) Snap crontab summary.html $(CONFIGETC)
	$(INSTALL) -m 755 -d `dirname $(PCP_PMSNAPCONTROL_PATH)`
	$(INSTALL) -m 644 control $(PCP_PMSNAPCONTROL_PATH)
endif

default_pcp:	default

install_pcp:	install
